Modernize packaging and CI#150
Merged
Merged
Conversation
The --universal flag produces a py2.py3 wheel, which is wrong for a Python 3-only package. Switch to the modern 'build' frontend which respects pyproject.toml and produces the correct wheel tags.
Signals to type checkers (mypy, pyright) that pygeofilter ships inline type annotations. Without this marker, downstream consumers cannot use the package's type hints.
The pre-commit step was commented out, meaning black, isort, flake8, and mypy were configured but never enforced. Uncomment it so linting is actually validated on every push and PR. Also fixes the pip3 install invocation (was using 'python -m pip3' which doesn't work).
The docs version was hardcoded to '0.0.3' and never updated. Import __version__ from pygeofilter.version so it stays in sync with the package automatically.
Replace the legacy setup.py + setup.cfg + MANIFEST.in + three requirements*.txt files with a single pyproject.toml using PEP 621 project metadata. Changes: - All project metadata, dependencies, and extras now in pyproject.toml - Dev/test/docs dependencies declared as optional-dependency groups - CI workflow uses 'pip install .[test,dev,...]' instead of requirements files - ReadTheDocs config uses 'pip install .[docs]' with pinned Python 3.12 - Package data (*.lark, py.typed) declared via [tool.setuptools.package-data] - Tool configs (isort, flake8, mypy, pytest) moved to pyproject.toml - Dropped Python 3.8 from classifiers (not tested in CI) Removed: - setup.py, setup.cfg, MANIFEST.in - requirements-test.txt, requirements-dev.txt, docs/requirements.txt
Ruff is a single tool that replaces all three linters/formatters, runs ~100x faster, and is configured in one place in pyproject.toml. Updates both the pre-commit config and the dev dependencies.
Adds pytest-cov to test dependencies and configures pytest to automatically report coverage with missing lines on every run.
W503 is a flake8-specific rule (line break before binary operator) that doesn't exist in Ruff. Ruff follows Black's formatting which already handles this correctly.
Fix 6 type errors that were hidden by the mypy<=1.10.0 pin: - ast.Like.pattern: narrow type from ScalarAstType to str (it's always a string — patterns can't be numeric) - solr/evaluate.py: convert Version to str before re-wrapping - cli.py: use dict[str, Any] for PARSERS to satisfy variance checks Remove the mypy version pin (was <=1.10.0, now unpinned) and update the pre-commit mirror from v1.15.0 to v2.1.0. All 56 source files now pass mypy cleanly.
Remove 3.9 from CI matrix, classifiers, requires-python, and ruff target-version. Minimum supported version is now Python 3.10.
tomkralidis
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernize the project's packaging, CI, and tooling — consolidating everything into a single
pyproject.tomland removing legacy files.Changes
Each change is its own commit:
actions/checkoutto@v4—@masteris deprecated and a supply-chain riskpython -m build— removes the--universalflag (Python 2 artifact) and switches to the modern build frontendpy.typedmarker — PEP 561 compliance so downstream consumers can use our type hints0.0.3, now reads dynamically frompygeofilter.versionpyproject.toml— replacessetup.py,setup.cfg,MANIFEST.in, and threerequirements*.txtfiles with a singlepyproject.toml. All metadata, dependencies, extras, and tool configs in one place.Files removed
setup.py,setup.cfg,MANIFEST.inrequirements-test.txt,requirements-dev.txt,docs/requirements.txtVerified
python -m buildproduces a correct wheel with all.larkgrammar files andpy.typedincluded